﻿using AutoMapper;
using Product.API.Write.Applications.Commands.Material;
using Product.API.Write.Applications.Commands.Products;
using Product.API.Write.Applications.Commands.Process;
using Product.API.Write.Applications.Commands.ProcessRoute;
using Product.API.Write.Applications.Commands.ProductProcess;
using Product.API.Write.Applications.Commands.Bom;
using ERP.Domain.Products;

namespace Product.API.Write.AutoMapper
{
    /// <summary>
    /// 轮廓映射
    /// </summary>
    public class MapperProfiles : Profile
    {
        /// <summary>
        /// 构造方法
        /// </summary>
        public MapperProfiles()
        {
            //CreateProductCommand和Product转换
            CreateMap<CreateProductCommand, ERP.Domain.Products.Product>().ReverseMap();

            //UpdateProductCommand和Product转换
            CreateMap<UpdateProductCommand, ERP.Domain.Products.Product>().ReverseMap();

            //CreateMaterialCommand和Material转换
            CreateMap<CreateMaterialCommand, ERP.Domain.Products.Material>().ReverseMap();

            //UpdateMaterialCommand和Material转换
            CreateMap<UpdateMaterialCommand, ERP.Domain.Products.Material>().ReverseMap();

            //CreateProcessCommand和Process转换
            CreateMap<CreateProcessCommand, ERP.Domain.Products.Process>().ReverseMap();

            //UpdateProcessCommand和Process转换
            CreateMap<UpdateProcessCommand, ERP.Domain.Products.Process>().ReverseMap();

            //CreateProcessRouteCommand和ProcessRoute转换
            CreateMap<CreateProcessRouteCommand, ERP.Domain.Products.ProcessRoute>().ReverseMap();

            //UpdateProcessRouteCommand和ProcessRoute转换
            CreateMap<UpdateProcessRouteCommand, ERP.Domain.Products.ProcessRoute>().ReverseMap();

            //CreateProductProcessCommand和ProductProcess转换
            CreateMap<CreateProductProcessCommand, ERP.Domain.Products.ProductProcess>().ReverseMap();

            //UpdateProductProcessCommand和ProductProcess转换
            CreateMap<UpdateProductProcessCommand, ERP.Domain.Products.ProductProcess>().ReverseMap();

            //CreateBomCommand和BomInfo转换
            CreateMap<CreateBomCommand, BomInfo>().ReverseMap();




        }
    }
}
